<?php
function sum($b1,$b2,$b3){
    return $b1+$b2+$b3;
}
    function avg($b1,$b2,$b3){
 $a=sum($b1,$b2,$b3);
 return $a/3;
    }
    
    function cj($b1,$b2,$b3){
        
   switch (intval((avg(80,60,87))/10)) 
   {
   case '10':
     echo "优秀";
     break;
   case '9':
     echo "优秀";
     break;
   case '8':
     echo "良好";
     break;
     case '7':
     echo "良好";
     break;
     case '6':
     echo "及格";
     break;
   default:
     echo "不及格";
    }}
cj(80,60,87);
?>